{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>发布新职位</title>
    <!-- 添加 SweetAlert2 CDN -->
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', sans-serif;
            background-color: #f5f5f5;
            padding: 20px;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
            background-color: #fff;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        .form-title {
            text-align: center;
            color: #333;
            margin-bottom: 30px;
            font-size: 24px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            margin-bottom: 8px;
            color: #333;
            font-weight: bold;
        }

        input[type="text"],
        textarea {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 16px;
        }

        textarea {
            min-height: 150px;
            resize: vertical;
        }

        .submit-btn {
            background-color: #4CAF50;
            color: white;
            padding: 12px 24px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            width: 100%;
            margin-top: 20px;
        }

        .submit-btn:hover {
            background-color: #45a049;
        }

        .error-message {
            color: #ff0000;
            margin-top: 5px;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1 class="form-title">发布新职位</h1>
        <form method="POST">
            {% csrf_token %}

            <div class="form-group">
                <label for="title">职位名称</label>
                <input type="text" id="title" name="title" required>
            </div>

            <div class="form-group">
                <label for="company">公司名称</label>
                <input type="text" id="company" name="company" required>
            </div>

            <div class="form-group">
                <label for="location">工作地点</label>
                <input type="text" id="location" name="location" required>
            </div>

            <div class="form-group">
                <label for="salary_range">薪资范围</label>
                <input type="text" id="salary_range" name="salary_range" placeholder="例如：8k-15k" required>
            </div>

            <div class="form-group">
                <label for="description">职位描述</label>
                <textarea id="description" name="description" required></textarea>
            </div>

            <div class="form-group">
                <label for="requirements">职位要求</label>
                <textarea id="requirements" name="requirements" required></textarea>
            </div>

            {% if error %}
            <div class="error-message">
                {{ error }}
            </div>
            {% endif %}

            <button type="submit" class="submit-btn">发布职位</button>
        </form>
    </div>
</body>
</html>
